package com.zmn.oms.business.interfaces.orderamount;

import com.zmn.base.price.common.dto.ProductPriceDRO;
import com.zmn.oms.common.dro.quotation3.EngineerDiscountDRO;
import com.zmn.oms.common.dro.quotation3.OrderAmountDRO;
import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.dto.orderamount.DiscountCalculateResultDTO;
import com.zmn.oms.model.dto.orderamount.DiscountDTO;
import com.zmn.oms.model.entity.discount.OrderDiscount;
import com.zmn.oms.model.entity.discount.OrderPayDiscount;
import com.zmn.oms.model.entity.product.OrderProduct;
import com.zmn.oms.model.entity.work.OrderWork;

import java.util.List;

/**
 * 类描述：订单金额计算服务
 *
 * @author heciqi
 * @date 2020/4/8 9:49
 */
public interface OrderAmountBService {

	/**
	 * 计算金额
	 *
	 * @param list
	 * @param amount
	 * @return
	 */
	DiscountCalculateResultDTO calculateDiscount(List<DiscountDTO> list, Integer amount);

	/**
	 * 获取产品价格
	 *
	 * @param cityId
	 * @param channelId
	 * @param showProductId
	 * @return
	 */
	com.zmn.common.dto2.ResponseDTO<ProductPriceDRO> getProductPriceDRO(Integer cityId, Integer channelId, Integer showProductId);

	/**
	 * 获取一口价优惠
	 *
	 * @param productPriceDRO
	 * @return
	 */
	DiscountDTO getFinalPriceDiscount(ProductPriceDRO productPriceDRO) throws OmsBaseException;

	/**
	 * 获取优惠券优惠
	 *
	 * @param cityId
	 * @param channelId
	 * @param showProductId
	 * @param userId
	 * @param itemCode
	 * @param amount
	 * @return
	 */
	DiscountDTO getCouponDiscount(Integer cityId, Integer channelId, Integer showProductId, Long userId, String itemCode, Integer amount) throws OmsBaseException;

	/**
	 * 获取支付金额
	 *
	 * @param productPriceDRO
	 * @return
	 */
	Integer getPayAmount(ProductPriceDRO productPriceDRO, Integer number);

	/**
	 * 重新计算价格
	 *
	 * @return
	 */
	OrderAmountDRO getQuotationOrderAmountByOrderIdAndWorkId(Long orderId, Long workId, Integer engineerDiscountId) throws OmsBaseException;

	/**
	 * 计价器接口计算价格
	 *
	 * @return
	 */
	OrderAmountDRO getQuotationOrderAmount(OrderWork orderWork, List<Integer> itemIdList, OrderProduct orderProduct, List<OrderDiscount> discountList, Integer engineerDiscountId, List<OrderPayDiscount> orderPayDiscountList) throws OmsBaseException;

	EngineerDiscountDRO getOrderEngineerDiscount(Long orderId, Long workId) throws OmsBaseException;

	/**
	 * 获取订单已付金额
	 * @param orderWork
	 * @return
	 */
	Integer getOrderWorkFactAmount(OrderWork orderWork);

	/**
	 * 获取订单剩余应收金额
	 * @return
	 */
	Integer getOrderWorkRemainingReceivableAmount(OrderWork orderWork);
}
